The present disclosure relates to a control apparatus, a storage device and a storage control method for a non-volatile memory, and more particularly to processing performed in the case where the end of data, which is requested to be written, does not match a boundary between physical regions, which are the smallest units in which a writing operation is performed, of the non-volatile memory.
Storage devices using a non-volatile memory such as a NAND type flash memory are becoming widely used. A non-volatile memory is used in memory cards, solid-state drives (SSDs), embedded MultiMediaCards (eMMCs), and the like used in, for example, various types of electronic equipment and information processing apparatuses.
A storage device using a flash memory is disclosed in Japanese Unexamined Patent Application Publication Nos. 2009-70098, 2007-334852, 2007-193838, and 2007-58840.
Physical addresses are used as addresses in a physical storage area in a non-volatile memory. Physical blocks, physical pages, and physical sectors are set by using the physical addresses. A plurality of physical sectors constitute a physical page, and a plurality of physical pages constitute a physical block.
An erasing operation (Erase) is performed per physical block, and a writing operation (Program) and a reading operation (Read) may be performed per physical page.
A host apparatus uses logical addresses to specify addresses. Logical blocks and logical pages having the logical addresses are related to the physical addresses described above. As a result, in the case where accessing of an actual flash memory is requested, a logical address is converted into a physical address and the actual flash memory is accessed by using the physical address.
Here, data requested to be written into the storage device, by the host apparatus, does not have an end that matches a boundary between physical pages (which are the smallest units in which a writing operation is performed) of the non-volatile memory on every occasion.
In the case where the end of the data requested to be written does not match the boundary between the physical pages, the last portion of the data is data having a size smaller than that of a physical page (such data being hereinafter referred to as under-page-size data). Since the smallest units in which a writing operation is performed are physical pages as described above, in the case where data specified by the logical address subsequent to that of the under-page-size data (that is, data subsequent to the under-page-size data) is later requested to be written, how the top portion of the data requested to be written (the size of the top portion is also smaller than that of a physical page) should be written is an issue.
In an existing method, it is designed that, regardless of whether or not the end of the data requested to be written matches the boundary between the physical pages, the entirety of the data requested to be written is written into a physical block subjected to processing. After that, in the case where the end of the written data does not match the boundary between the physical pages and the data subsequent to the written data is requested to be written, since there is a rule that the smallest units in which a writing operation is performed are physical pages, the under-page-size data that has already been written is combined with the under-page-size data requested to be written, which is the top portion of the data requested to be written. Then, the combined data having a size of a physical page is newly written into another physical page.